<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">

        /*对所有的div元素起作用*/
        div {
            width: 380px;
            height: 60px;
            background-color: #ddd;
            border: 2px dotted black;
        }

        /*对处于div之内且class为a的元素起作用*/
        div > .a {
            width: 300px;
            height: 35px;
            border: 2px dotted black;
            background-color: #888;
        }
    </style>
</head>
<body>
<div>没有任何属性的div元素</div>
<div><p class="a">class为a的元素，且是div的子节点元素</p></div>
<div>
    <section><p class="a">class为a的元素，且是处于div内部的元素</p></section>
</div>
</body>
</html>
